﻿using System.Web.Mvc;
using GiaoXuLanTranh_MucVu.Models;
using InfoTech.LanTranh.MucVu.Bussiness;
using InfoTech.LanTranh.MucVu.Service;
using InfoTech.Mvc.LanTranh.MucVu.Models;

namespace GiaoXuLanTranh_MucVu.Areas.AdminCP.Controllers
{
    [Authorize]
    public class UpdateResultController : Controller
    {
        //
        // GET: /AdminCP/UpdateResult/
        [HttpPost]
        public ActionResult Index(string id)
        {
            EXCEPTION exception = EXCEPTIONService.GetException(id);
            if (exception != null)
            {
                if (exception.RESULTTYPE == ResultType.ATTENTION)
                    return View("Attention", new EXCEPTIONModel(exception));
                if (exception.RESULTTYPE == ResultType.SUCESS)
                    return View("Success", new EXCEPTIONModel(exception));
                if (exception.RESULTTYPE == ResultType.ERROR)
                    return View("Error", new EXCEPTIONModel(exception));

                return View("Information", new EXCEPTIONModel(exception));

            }
            return Content("");
        }

        public ActionResult Attention(EXCEPTIONModel exception)
        {
            return View(exception);
        }

        public ActionResult Information(EXCEPTIONModel exception)
        {
            return View(exception);
        }

        public ActionResult Success(EXCEPTIONModel exception)
        {
            return View(exception);
        }

        public ActionResult Error(EXCEPTIONModel exception)
        {
            return View(exception);
        }

    }
}
